#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

int inverse(int n)
{
	int tmp = n;
	int sum = 0;
	while (tmp > 10)
	{
		sum = sum * 10 + tmp % 10;
		tmp = tmp / 10;
	}
	sum = sum * 10 + tmp;
	return sum;
}

int main()
{
	int m;
	int mir;
	scanf("%d", &m);
	mir = inverse(m);
	printf("%d", m + mir);
	return 0;
}